package com.tiancikeji.zaoke.app.biz.impl;

import org.apache.commons.lang.StringUtils;

import com.tiancikeji.zaoke.app.biz.ZoneBiz;
import com.zaoke.web.bo.zone.Zone;
import com.zaoke.web.service.zone.ZoneService;

public class ZoneBizImpl implements ZoneBiz {

	private ZoneService zoneService;
	
	public Zone getZoneById(long zoneId) {
		Zone zone = zoneService.getZoneById(zoneId, true);
		
		if(zone != null && zone.getState() == Zone.STATE_ACTIVE && zone.getType() == Zone.TYPE_PICK && StringUtils.isNotBlank(zone.getName())
				&& StringUtils.isNotBlank(zone.getPickStartTime()) && StringUtils.isNotBlank(zone.getPickEndTime()))
			return zone;
		else
			return null;
	}

	public ZoneService getZoneService() {
		return zoneService;
	}

	public void setZoneService(ZoneService zoneService) {
		this.zoneService = zoneService;
	}
}
